<template>
  <div class="outer">
    <!-- 当传入给子组件的数据不一样是 使用插槽 自定义内容 -->
    <!-- 
        使用组件的时候,可以传递插槽,使用v-slot指令向指定的插槽插入内容:v-slot:center
        v-slot指令只能使用在组件或者<template>上
        v-slot:center可以简写为#center
       -->
    <Tab title="美食">
      <!-- <template #content> -->
      <template v-slot:content>
        <div>
          <img
            width="200"
            src="https://img2.baidu.com/it/u=2082735800,426564252&fm=253&fmt=auto&app=138&f=GIF?w=400&h=300"
            alt=""
          />
        </div>
      </template>
      <template #footer>
        <div>
          <span>火锅好吃</span>
          <span>火锅好香</span>
          <span>火锅好辣</span>
        </div>
      </template>
    </Tab>
    <Tab title="游戏">
      <template #content>
        <div>
          <ul>
            <li>LoL</li>
            <li>CF</li>
            <li>DNF</li>
          </ul>
        </div>
      </template>
      <template #footer>
        <div>
          <a href="">戒网瘾</a>
          <br />
          <a href="">杨永信</a>
        </div>
      </template>
    </Tab>
    <Tab title="电影">
      <template #content>
        <div>
          <!-- autoplay muted 自动播放 静音 -->
          <video src="./01.mp4" width="200" autoplay muted></video>
        </div>
      </template>

      <template #footer>
        <div>
          <span>经典</span>|
          <span>热门</span>|
          <span>小众</span>|
        </div>
      </template>

    </Tab>
  </div>
</template>

<script>
import Tab from "./components/Tab";
import { v4 as uuidv4 } from "uuid";

export default {
  name: "App",
  data() {
    return {
      tabData: [
        { id: uuidv4(), title: "美食", list: ["火锅", "烧烤", "小龙虾"] },
        { id: uuidv4(), title: "游戏", list: ["LoL", "DNF", "CS", "Dota"] },
        {
          id: uuidv4(),
          title: "电影",
          list: ["独行月球", "智取威虎山", "绿皮书"],
        },
      ],
    };
  },
  components: {
    Tab,
  },
  methods: {},
};
</script>

<style scoped>
/* scoped  当前文件可以使用*/
.outer {
  height: 400px;
  background: yellowgreen;
  display: flex;
  justify-content: space-around;
}
</style>

